<template>
  <main>
    <van-notice-bar
      text="This project is served and bundled with Vite. The recommended IDE setup is VSCode + Volar. If you need to test your components and web pages, check out Cypress and Cypress Component Testing.
More instructions are available in README.md."
      left-icon="volume-o"
    />

    <TheWelcome />

    <van-button @click="toHome">点击跳转About页面</van-button>
  </main>
</template>

<script setup lang="ts">
import TheWelcome from "../components/TheWelcome.vue";
import { useRouter } from "vue-router";
import { tran } from "@/api/account";
const router = useRouter();
// 赋值跳转路由地址
const toHome = () => {
  router.push({
    name: "about",
  });
};
// 请求接口
tran({
  q: "apple",
  from: "en",
  to: "zh",
  appid: "dfac94a3489fe9fca7c3221cbf7525ff",
  salt: "",
  sign: "",
})
  .then((res) => {
    console.log("tran---", res);
  })
  .catch((err) => {
    console.log("tran---", err);
  });
</script>
